/* SPDX-License-Identifier: GPL-2.0
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Description: usbnet driver Vendor Hooks
 */

#ifdef CONFIG_VENDOR_USB_SERIAL_HOOKS
#undef TRACE_SYSTEM
#define TRACE_SYSTEM usb_serial

#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_USB_SERIAL_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_USB_SERIAL_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>

struct tty_struct;
struct tty_driver;
struct usb_device;
struct usb_serial_port;
struct urb;
struct usb_serial;

DECLARE_HOOK(vendor_usb_serial_minor_check,
	TP_PROTO(int minor),
	TP_ARGS(minor));

DECLARE_HOOK(vendor_usb_serial_minor_state_check,
	TP_PROTO(int minor),
	TP_ARGS(minor));

DECLARE_HOOK(vendor_option_init_termios,
	TP_PROTO(struct tty_struct *tty),
	TP_ARGS(tty));

DECLARE_HOOK(vendor_usb_serial_info,
	TP_PROTO(struct tty_driver *usb_serial_tty_driver,
		struct usb_device *dev, struct usb_serial_port *port),
	TP_ARGS(usb_serial_tty_driver, dev, port));

DECLARE_HOOK(vendor_usb_serial_action,
	TP_PROTO(int para, void *action),
	TP_ARGS(para, action));

DECLARE_HOOK(vendor_usb_wwan_zlp_process,
	TP_PROTO(int dir, struct urb *urb, struct usb_serial *serial),
	TP_ARGS(dir, urb, serial));

#endif
/* This part must be outside protection */
#include <trace/define_trace.h>

#else

#include <linux/tracepoint.h>

struct tty_struct;
struct tty_driver;
struct usb_device;
struct usb_serial_port;
struct urb;
struct usb_serial;

DECLARE_EVENT_NOP(vendor_usb_serial_minor_check,
	TP_PROTO(int minor),
	TP_ARGS(minor));

DECLARE_EVENT_NOP(vendor_usb_serial_minor_state_check,
	TP_PROTO(int minor),
	TP_ARGS(minor));

DECLARE_EVENT_NOP(vendor_option_init_termios,
	TP_PROTO(struct tty_struct *tty),
	TP_ARGS(tty));

DECLARE_EVENT_NOP(vendor_usb_serial_info,
	TP_PROTO(struct tty_driver *usb_serial_tty_driver,
		struct usb_device *dev, struct usb_serial_port *port),
	TP_ARGS(usb_serial_tty_driver, dev, port));

DECLARE_EVENT_NOP(vendor_usb_serial_action,
	TP_PROTO(int para, void *action),
	TP_ARGS(para, action));

DECLARE_EVENT_NOP(vendor_usb_wwan_zlp_process,
	TP_PROTO(int dir, struct urb *urb, struct usb_serial *serial),
	TP_ARGS(dir, urb, serial));

#endif  /* CONFIG_VENDOR_USB_SERIAL_HOOKS */
